package com.ybg.ebs_memory.sys;

import com.ybg.ebs_memory.data.Data;

public class EBS {
    private Data data;

    public EBS() {
        data = new Data();
    }

    public void start(){
        while (true){
            if(data.isLogin()){
                int choice = data.showLoginMenus();
                switch (choice){
                    case 1:
                        data.modifyPass();
                        break;
                    case 2:
                        data.charge();
                        break;
                    case 3:
                        data.showMe();
                        break;
                    case 4:
                        data.showCategories();
                        break;
                    case 5:
                        data.showProducts(1,false);
                        break;
                    case 6:
                        data.addToChart();
                        break;
                    case 7:
                        data.removeFromChart();
                        break;
                    case 8:
                        data.showCart();
                        break;
                    case 9:
                        data.placeOrder();
                        break;
                    case 10:
                        data.payOrder();
                        break;
                    case 11:
                        data.showMyOrders(false);
                        break;
                    case 12:
                        data.logout();
                        break;
                }
            }else{
                int choice = data.showNotLoginMenus();
                switch (choice){
                    case 1:
                        data.register();
                        break;
                    case 2:
                        data.login();
                        break;
                }
            }
        }
    }
}
